home *** CD-ROM | disk | FTP | other *** search
- /* Example03.Plot - Illustration of 1-1 scaling for polar plot */
- /* Modified for RexxPlPlot by Glenn M. Lewis - 9/12/89 */
-
- address 'PlPlot'
- say 'Please be patient...'
-
- dtr=3.141592654/180.0
- do i=1 to 361
- x0.i=cos(dtr*(i-1))
- y0.i=sin(dtr*(i-1))
- end i
-
- 'plstar(1,1);'
-
- /* Set up viewport and window, but do not draw box */
-
- 'plenv(-1.3,1.3,-1.3,1.3,1,-2);'
- do i=1 to 10
- do j=1 to 361
- x.j=0.1*i*x0.j
- y.j=0.1*i*y0.j
- end j
-
- /* Draw circles for polar grid */
-
- 'plline(361,x,y);'
- end i
-
- do i=0 to 11
- theta=30*i
- dx=cos(dtr*theta)
- dy=sin(dtr*theta)
- minusdx=-dx
- minusdy=-dy
-
- /* Draw radial spokes for polar grid */
-
- 'pljoin(0.0,0.0,dx,dy);'
-
- /* Write labels for angle */
-
- if dx>=0 then
- 'plptex(dx,dy,dx,dy,-0.15,theta);'
- else
- 'plptex(dx,dy,minusdx,minusdy,1.15,theta);'
- endif
- end i
-
- /* Draw the graph */
-
- do i=1 to 181
- r=sin(dtr*5.0*(i-1))
- x.i=r*x0.i
- y.i=r*y0.i
- end i
- 'plline(181,x,y);'
-
- 'plmtex("t",2.0,0.5,0.5,"\frPLPLOT Example 3 - r(\gh)=sin 5\gh");'
-
- /* Close the plot at end */
-
- 'plend();'
-
- exit 0
-